package collections;

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.LinkedList;

/**
 * Created by pc on 2015/2/17.
 * stack implementation, FILO*
 */
public class ArrayDequeDemo {
    public static void main(String args[]){
        //ArrayDeque
        Deque<String> stack = new ArrayDeque<String>(10);
        stack.push("aaaa");
        stack.push("bbbb");
        stack.push("cccc");
        System.out.println(stack);
        System.out.println(stack.pop());
        System.out.println(stack);
        
       
        //LinkedList
        Deque<String> linkStack = new LinkedList<String>();
        linkStack.push("1111");
        linkStack.push("2222");
        linkStack.push("3333");
        System.out.println(linkStack);
        System.out.println(linkStack.pop());
        System.out.println(linkStack);


    }
}
